#ifndef PIECE_H
#define PIECE_H

#include <QWidget>
#include <QList>
#include <QString>
#include <cell.h>
#include <board.h>

class Piece : public QWidget
{
    Q_OBJECT
public:
    struct State{
        int x, y;
    };
    explicit Piece(Cell *cell, QString color, QWidget *parent = nullptr);
    void loadPieceImage(QString name);
    virtual QList<Cell*> getTips(Board *board) = 0;
    void setCell(Cell *cell);
    Cell* getCell();
    QString getColor() const;
    bool isFriend(Piece *piece);
    void toCell(Cell *to);
    Cell* isMove(int delta_x, int delta_y, Board *board);
protected:
    virtual void paintEvent(QPaintEvent *event);
private:
    Cell *cell;
    QString color = "";
    State state;
signals:

};

#endif // PIECE_H
